part of '../../repository.dart';

const _kGooglePlayPurchasedSubscriptionCancellationUnspecifiedSurveyReasonValue = 'unspecified';
const _kGooglePlayPurchasedSubscriptionCancellationOtherSurveyReasonValue = 'other';
const _kGooglePlayPurchasedSubscriptionCancellationInsufficientUseSurveyReasonValue =
    'insufficient_use';
const _kGooglePlayPurchasedSubscriptionCancellationTechnicalIssuesSurveyReasonValue =
    'technical_issues';
const _kGooglePlayPurchasedSubscriptionCancellationCostSurveyReasonValue = 'cost';
const _kGooglePlayPurchasedSubscriptionCancellationNotBestAppSurveyReasonValue = 'not_best_app';

class _GooglePlayPurchasedSubscriptionCancellationSurveyReasonDto extends Equatable {
  const _GooglePlayPurchasedSubscriptionCancellationSurveyReasonDto._internal({
    required this.reasonString,
  });

  final String reasonString;

  @override
  List<Object?> get props {
    return [
      reasonString,
    ];
  }

  factory _GooglePlayPurchasedSubscriptionCancellationSurveyReasonDto.fromString(
      String reasonString) {
    return _GooglePlayPurchasedSubscriptionCancellationSurveyReasonDto._internal(
      reasonString: reasonString,
    );
  }

  GooglePlayPurchasedSubscriptionCancellationSurveyReason toEntity() {
    return switch (reasonString) {
      _kGooglePlayPurchasedSubscriptionCancellationUnspecifiedSurveyReasonValue =>
        GooglePlayPurchasedSubscriptionCancellationSurveyReason.unspecified,
      _kGooglePlayPurchasedSubscriptionCancellationOtherSurveyReasonValue =>
        GooglePlayPurchasedSubscriptionCancellationSurveyReason.other,
      _kGooglePlayPurchasedSubscriptionCancellationInsufficientUseSurveyReasonValue =>
        GooglePlayPurchasedSubscriptionCancellationSurveyReason.insufficientUse,
      _kGooglePlayPurchasedSubscriptionCancellationTechnicalIssuesSurveyReasonValue =>
        GooglePlayPurchasedSubscriptionCancellationSurveyReason.technicalIssues,
      _kGooglePlayPurchasedSubscriptionCancellationCostSurveyReasonValue =>
        GooglePlayPurchasedSubscriptionCancellationSurveyReason.cost,
      _kGooglePlayPurchasedSubscriptionCancellationNotBestAppSurveyReasonValue =>
        GooglePlayPurchasedSubscriptionCancellationSurveyReason.notBestApp,
      _ => throw UnimplementedError(),
    };
  }
}
